package easy;

import java.util.ArrayList;
import java.util.List;

public class a1441_用栈操作构建数组 {
    public List<String> buildArray(int[] target, int n) {
        List<String> list=new ArrayList<>();
        for (int i=0,j=1;j<=n;j++){
            if (i == target.length) {
                break;
            }
            if (target[i]==j){
                list.add("Push");
                i++;
            }else {
                list.add("Push");
                list.add("Pop");
            }
        }
        return list;
    }
}
